<template>
  <div>
    <div class="menu-container">
      <a-menu
        style="width: 200px; position: fixed; border-radius: 7px; background-color: white;box-shadow: 0 0 10px #888; font-size: 60px;"
        :default-selected-keys="['1']" :selected-keys="[active]" @click="handleClick">
        <a-menu-item key="1" @click="searchRoutes"
          style="font-size: 20px; height: 60px;line-height: 60px; vertical-align: middle;">
          <a-icon type="apartment" />路线
        </a-menu-item>
        <a-menu-item key="2" @click="searchUsers"
          style="font-size: 20px; height: 60px;line-height: 60px; vertical-align: middle;">
          <a-icon type="user" />用户
        </a-menu-item>
      </a-menu>
    </div>

  </div>
</template>

<script>
export default {
  methods: {
    handleClick() { },
    searchRoutes() {
      this.$router.push({
        path: '/search/routes',
        query: { keyword: this.$route.query.keyword },
      })
    },
    searchUsers() {
      this.$router.push({
        path: '/search/users',
        query: { keyword: this.$route.query.keyword },
      })
    },
  },
  computed: {
    active() {
      return this.$route.path === '/search/routes' ? '1' : '2'
    },
  },
  props: {
    keyword: {
      type: String,
      default: '',
    },
  },
}
</script>

<style>
.menu-container {
  margin-top: 100px;
  border-radius: 5px;
  background-color: transparent;
}
</style>